package com.example.rabbitmq.producer;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer2 {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    // 发送routing日志消息的方法
    public void sendLog(String message) {
        rabbitTemplate.convertAndSend("test_direct", "directs", message);

    }


}
